import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';

@Entity('deployments')
export class Deployment {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  name: string;

  @Column()
  version: string;

  @Column()
  environment: string;

  @Column({ default: 'pending' })
  status: string;

  @Column({ nullable: true })
  description: string;

  @Column({ nullable: true })
  initiatedBy: string;

  @Column({ nullable: true })
  commitHash: string;

  @Column({ nullable: true })
  buildId: string;

  @CreateDateColumn()
  createdAt: Date;

  @UpdateDateColumn()
  updatedAt: Date;

  @Column({ nullable: true })
  completedAt: Date;
} 